package client.pantalles;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import javax.swing.JComboBox;

public class S2AltaSolicitud extends JPanel {
	
	private JTextField textFieldNumSolicitud;
	private JTextField textFieldNumBastidor;
	private JTextField textFieldMatricula;
	private JTextField textFieldMarca;
	private JTextField textFieldModel;
	private JTextField textFieldComentaris;
	private JTextField textFieldNumPolissa;
	
	private final JFrame parent;

	/**
	 * Create the panel.
	 */
	public S2AltaSolicitud(JFrame frame) {
		
		parent = frame;
		
		JPanel panel = new JPanel();
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(panel, GroupLayout.DEFAULT_SIZE, 430, Short.MAX_VALUE)
					.addContainerGap())
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addComponent(panel, GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
					.addContainerGap())
		);
		
		JLabel lblNSollicitud = new JLabel("N\u00BA Sol\u00B7licitud");
		
		textFieldNumSolicitud = new JTextField();
		textFieldNumSolicitud.setColumns(10);
		
		JLabel lblNBastidor = new JLabel("N\u00BA Bastidor");
		
		textFieldNumBastidor = new JTextField();
		textFieldNumBastidor.setColumns(10);
		
		JLabel lblMatrcula = new JLabel("Matr\u00EDcula");
		
		textFieldMatricula = new JTextField();
		textFieldMatricula.setColumns(10);
		
		JLabel lblMarca = new JLabel("Marca");
		
		textFieldMarca = new JTextField();
		textFieldMarca.setColumns(10);
		
		JLabel lblModel = new JLabel("Model");
		
		textFieldModel = new JTextField();
		textFieldModel.setColumns(10);
		
		JLabel lblComentaris = new JLabel("Comentaris");
		
		textFieldComentaris = new JTextField();
		textFieldComentaris.setColumns(10);
		
		JButton btnAlta = new JButton("Alta");
		btnAlta.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				parent.setContentPane(new JPanel());
				parent.pack();
				
			}
		});
		
		JButton btnCancellar = new JButton("Cancel.lar");
		btnCancellar.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				parent.setContentPane(new JPanel());
				parent.pack();
				
			}
		});
		
		JLabel lblEstat = new JLabel("Estat");
		
		JComboBox comboBoxEstat = new JComboBox();
		
		JLabel lblAssaguradora = new JLabel("Assaguradora");
		
		JComboBox comboBox_1Assaguradora = new JComboBox();
		
		JLabel lblNPolissa = new JLabel("N\u00BA Polissa");
		
		textFieldNumPolissa = new JTextField();
		textFieldNumPolissa.setColumns(10);
		GroupLayout gl_panel = new GroupLayout(panel);
		gl_panel.setHorizontalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addGap(55)
					.addComponent(btnAlta, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
					.addComponent(btnCancellar, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE)
					.addGap(57))
				.addGroup(gl_panel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblNSollicitud)
						.addComponent(lblNBastidor)
						.addComponent(lblMatrcula)
						.addComponent(lblMarca)
						.addComponent(lblModel)
						.addComponent(lblComentaris)
						.addComponent(lblAssaguradora)
						.addComponent(lblNPolissa))
					.addGap(42)
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(textFieldNumPolissa, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(textFieldComentaris, GroupLayout.PREFERRED_SIZE, 275, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
							.addComponent(textFieldMatricula, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addGroup(gl_panel.createParallelGroup(Alignment.TRAILING, false)
								.addComponent(comboBox_1Assaguradora, Alignment.LEADING, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
								.addComponent(textFieldModel, Alignment.LEADING)
								.addComponent(textFieldMarca, Alignment.LEADING))
							.addGroup(gl_panel.createSequentialGroup()
								.addGroup(gl_panel.createParallelGroup(Alignment.TRAILING, false)
									.addComponent(textFieldNumBastidor, Alignment.LEADING)
									.addComponent(textFieldNumSolicitud, Alignment.LEADING))
								.addGap(48)
								.addComponent(lblEstat)
								.addGap(28)
								.addComponent(comboBoxEstat, 0, 88, Short.MAX_VALUE))))
					.addGap(36))
		);
		gl_panel.setVerticalGroup(
			gl_panel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNSollicitud)
						.addComponent(textFieldNumSolicitud, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblEstat)
						.addComponent(comboBoxEstat, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNBastidor)
						.addComponent(textFieldNumBastidor, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblMatrcula)
						.addComponent(textFieldMatricula, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblMarca)
						.addComponent(textFieldMarca, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblModel)
						.addComponent(textFieldModel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblAssaguradora)
						.addComponent(comboBox_1Assaguradora, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_panel.createParallelGroup(Alignment.TRAILING)
						.addGroup(gl_panel.createSequentialGroup()
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(lblNPolissa)
							.addPreferredGap(ComponentPlacement.RELATED, 17, Short.MAX_VALUE))
						.addGroup(gl_panel.createSequentialGroup()
							.addPreferredGap(ComponentPlacement.RELATED)
							.addComponent(textFieldNumPolissa, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
							.addPreferredGap(ComponentPlacement.RELATED)))
					.addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
						.addComponent(textFieldComentaris, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblComentaris))
					.addGap(29)
					.addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnAlta)
						.addComponent(btnCancellar))
					.addGap(42))
		);
		panel.setLayout(gl_panel);
		setLayout(groupLayout);

	}
}
